package com.test.springboot.mybatis.entity;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.test.springboot.mybatis.entity.enums.EnumPayType;
import com.test.springboot.mybatis.utils.CustomDateTimeDeserializer;
import com.test.springboot.mybatis.utils.CustomDateTimeSerializer;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;

/**
 * @author chenxubing
 */
@Data
public class PayRecordDetail {
    private int        id          = 0;

    private int        payRecordId = 0;

    @JsonSerialize(using = CustomDateTimeSerializer.class)
    @JsonDeserialize(using = CustomDateTimeDeserializer.class)
    private Date       createTime  = new Date();

    @JsonSerialize(using = CustomDateTimeSerializer.class)
    @JsonDeserialize(using = CustomDateTimeDeserializer.class)
    private Date       opTime      = new Date();

    private byte       payType     = 0;

    private String     couponCode  = "";

    private BigDecimal money       = BigDecimal.ZERO;

    private byte        couponNum   = 0;

    private String     extInfo     = "";

    private String     remark      = "";

    private byte       deleteFlag  = 0;

    public EnumPayType getPayTypeEnum() {
        return EnumPayType.of(payType);
    }
    
}
